import Vue from 'vue'
import Vuex from 'vuex'
import tools from "@/tools";

export default {
    state: () => ({
        isLogin: tools.getCookie("isLogin") || "no",
        username: tools.getCookie("loginUserName") || "",
        password: tools.getCookie("token_pass") || ""
    }),
    mutations: {
        set_isLogin(state, d){
            state.isLogin = d;
        },
        set_username(state, d){
            state.username = d;
        },
        set_password(state, d){
            state.password = d;
        },
    },
    namespaced: true    // 改变mutations，可以直接使用user/setisLogin
}
